import { loginAPI } from '@/api/user'

import {getCategoryListAPI} from '@/api/home' 
const state = () => {
  return {
    categoryList:[]
  }
}
const mutations = {
  setCategoryList:(state,list)=>{
    state.categoryList = list
  }
}
const actions = {
  setCategoryListAction:async({commit})=>{
    const res = await getCategoryListAPI()
    if(res.code === '1'){
      commit('setCategoryList',res.result)
    }
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
